require 'memcache'
require './gps'

cache = MemCache.new('localhost:11211',{:namespace => 'vehicle_mc'})
gps1 = Gps.new
gps1.update({:vehicle_no=>'110098', :lng=>122354500, :lat=>37051200, :speed=>60000, :direction=> 3200,:datetime=>'2012-03-19 10:25:40'})
cache.set('110098', gps1)  
gps2 = Gps.new
gps2.update({:vehicle_no=>'101280', :lng=>122354600, :lat=>37053100, :speed=>60000, :direction=> 3200,:datetime=>'2012-03-19 10:25:40'})
cache.set('101280', gps2)  
p cache.get('101280')
p cache.stats()
